package bomb.utils;

import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;


public class Arquivo {
    
    
    private static FileWriter escritor = null;
    private static PrintWriter saida = null;
    private static FileReader leitor = null;
    private static BufferedReader entrada = null;
    
    public static void carregar() throws IOException {
        leitor = new FileReader("scores");  
        entrada = new BufferedReader(leitor);
        for(int fase=0; fase<6; fase++){
            for(int k=0; k<10; k++) {
                Highscores.pegarScore(fase, k, Integer.parseInt(entrada.readLine()));
            }
        }
        
    }
    
    public static void gravar() throws IOException{
        escritor = new FileWriter("scores");
        saida = new PrintWriter(escritor,true);
        for(int fase=0; fase<6; fase++){
            for(int k=0; k<10; k++) {
                saida.println(Highscores.getScore(fase, k));
            }
        }
    }
}
